/*
 * @Description: 详情弹框
 * @Author: ZhangHan
 * @Date: 2025-05-07 14:10:24
 * @LastEditTime: 2025-07-22 22:34:34
 * @LastEditors: Zhanghan
 */
import { ProModal } from "@/components/ProComponents";
import { useState } from "react";

interface DetailModalProps {
  modalProps: any;
  onCancel: () => void;
  onOk?: () => void;
}

const DetailModal = ({ modalProps, onCancel, onOk }: DetailModalProps) => {
  const [info, setInfo] = useState<any>();

  const renderUserContent = (record: any) => {
    if (!record) return <div>加载中...</div>;
    setInfo(record);
    return (
      <div>
        <div className="mb-4">视频效果仅供参考，请以实际效果为准（实际效果更佳）</div>
        <video
          src={info?.videoUrl}
          controls
          style={{ width: "100%", height: "58vh" }}
        />
      </div>
    );
  };

  return (
    <ProModal
      {...modalProps}
      renderContent={renderUserContent}
      onCancel={onCancel}
      onOk={onOk || onCancel}
      width={800}
      title={info?.name ?? "详情"}
    />
  );
};

export default DetailModal;
